﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DXW
{
    public class GetSetRadioGroup
    {
        public static int Check(string gt)
        {
            int Vitri = 0;
            foreach (char a in gt)
            {
                if (a == '1')
                {
                    Vitri++;
                    break;
                }
                else Vitri++;
            }
            return Vitri - 1;
        }

        public static string GetCheck(int Vitri, int Soluong)
        {
            char[] Ketqua = new char[Soluong];
            for (int i = 0; i < Soluong; i++)
            {
                if (i == Vitri)
                {
                    Ketqua[i] = '1';
                }
                else Ketqua[i] = '0';
            }

            string KQ = "";
            for (int i = 0; i < Soluong; i++)
            {
                KQ += Ketqua[i].ToString();
            }
            return KQ;
        }
    }
}
